﻿#ifndef CANVASLINE_H
#define CANVASLINE_H

#include "canvasitem.h"

class CanvasLine : public CanvasItem
{
public:
    CanvasLine();
    virtual QPainterPath shape() const;
    void SetStart(QPointF startPos);
protected:
    virtual void paint(QPainter *painter,
                         const QStyleOptionGraphicsItem *option,
                         QWidget *widget);
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private:
    QVector<QPointF> m_vecPoints;
    QPainterPath m_linePath;
    int m_id;
};

#endif // CANVASLINE_H
